/**
 * 移除字符串中的*
 *
 * @USER: Administrator
 * @DATE: 2024/9/15 上午9:03
 * @VERSION: 1.0.0
 */
public class LC2390 {

    public static void main(String[] args) {
        LC2390 lc2390 = new LC2390();
        System.out.println(lc2390.removeStars("leet**cod*e"));
    }

    public String removeStars(String s) {
        StringBuilder result = new StringBuilder();
        for (char c : s.toCharArray()) {
            if (c!='*'){
                result.append(c);
            }else {
                result.setLength(result.length()-1);
            }
        }
        return result.toString();
    }
}

